package main

import (
	"fmt"

	"gitee.com/wz-open-platform/wzopen-sdk-go/constants"
	"gitee.com/wz-open-platform/wzopen-sdk-go/model"
	"gitee.com/wz-open-platform/wzopen-sdk-go/sdk"
	"gitee.com/wz-open-platform/wzopen-sdk-go/tea"
)

func main() {
	appId := "请联系万桩工作人员获取"
	appSecret := "请联系万桩工作人员获取"
	baseURL := "请联系万桩工作人员获取"
	deviceNum := "请联系万桩工作人员获取"
	tradeNo := "请联系万桩工作人员获取"

	client := sdk.NewClient(appId, appSecret, baseURL)

	chargeMode := constants.ChargeModeEnergyMode
	res, err := client.ChargeStart(&model.ChargeStart{DevicePort: tea.String("1"), ChargeID: tea.Int(10033), TotalFee: tea.Int(100), ChargeMode: &chargeMode, DeviceNum: tea.String(deviceNum)})
	fmt.Println("ChargeStart   =====> ", res, err)

	res, err = client.ChargeStop(&model.ChargeStop{DevicePort: tea.String("1"), ChargeID: tea.Int(10033), DeviceNum: tea.String(deviceNum)})
	fmt.Println("ChargeStop   =====> ", res, err)

	rescedl, errcedl := client.GetCompanyExpireDeviceList(&model.GetCompanyExpireDeviceListReq{PageModel: model.PageModel{Page: 1, Limit: 10}})
	fmt.Println("GetCompanyExpireDeviceList   =====> ", rescedl, errcedl)

	rescro, errcro := client.CreateCompanyRenewOrder(&model.CreateCompanyRenewOrderReq{OutTradeNo: tea.String(tradeNo), DeviceNums: &[]string{deviceNum}})
	fmt.Println("CreateCompanyRenewOrder   =====> ", rescro, errcro)

	rescrs, errcrs := client.GetCompanyRenewStatus(&model.GetCompanyRenewStatusReq{OutTradeNo: tradeNo})
	fmt.Println("GetCompanyRenewStatus   =====> ", rescrs, errcrs)

	resdsoci, errdsoci := client.GetDeviceSettingOnlineCardInfo(&model.GetDeviceSettingOnlineCardInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceSettingOnlineCardInfo   =====> ", resdsoci, errdsoci)

	reso, erro := client.GetDeviceSettingSafetyInfo(&model.GetDeviceSettingSafetyInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceSettingSafetyInfo   =====> ", reso, erro)

	resmti, errmti := client.GetDeviceModeTimeInfo(&model.GetDeviceModeTimeInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceModeTimeInfo   =====> ", resmti, errmti)

	resmt1i, errmt1i := client.GetDeviceModeTime1Info(&model.GetDeviceModeTime1InfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceModeTime1Info   =====> ", resmt1i, errmt1i)

	ressci, errsci := client.GetDeviceSettingCoinInfo(&model.GetDeviceSettingCoinInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceSettingCoinInfo   =====> ", ressci, errsci)

	resfmd, errfmd := client.FindMultiDevices(&model.FindMultiDevicesReq{DeviceNums: &[]string{deviceNum}})
	fmt.Println("FindMultiDevices   =====> ", resfmd, errfmd)

	resda, errda := client.DeviceAdd(&model.DeviceAddReq{DeviceNum: tea.String(deviceNum)})
	fmt.Println("DeviceAdd   =====> ", resda, errda)

	resmwi, errmwi := client.GetDeviceModeWorkInfo(&model.GetDeviceModeWorkInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceModeWorkInfo   =====> ", resmwi, errmwi)

	resm1i, errm1i := client.GetDeviceModeWork1Info(&model.GetDeviceModeWork1InfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceModeWork1Info   =====> ", resm1i, errm1i)

	resmpi, errmpi := client.GetDeviceModePowerInfo(&model.GetDeviceModePowerInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceModePowerInfo   =====> ", resmpi, errmpi)

	resdmp, errdmp := client.GetDeviceModePower1Info(&model.GetDeviceModePower1InfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceModePower1Info   =====> ", resdmp, errdmp)

	resdfl, errdfl := client.DeviceFindList(&model.DeviceFindListReq{Page: 1, PageSize: 20})
	fmt.Println("DeviceFindList   =====> ", resdfl, errdfl)

	resdd, errdd := client.DeviceDel(&model.DeviceDelReq{DeviceNum: deviceNum})
	fmt.Println("DeviceDel   =====> ", resdd, errdd)

	resgd, errgd := client.DeviceGetMode(&model.DeviceGetModeReq{DeviceNum: deviceNum})
	fmt.Println("DeviceGetMode   =====> ", resgd, errgd)

	ressm, errsm := client.DeviceSaveMode(&model.DeviceSaveModeReq{DeviceNum: tea.String(deviceNum)})
	fmt.Println("DeviceSaveMode   =====> ", ressm, errsm)

	ressuf, errsuf := client.GetDeviceSettingUserInfo(&model.GetDeviceSettingUserInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceSettingUserInfo   =====> ", ressuf, errsuf)

	ressndi, errsndi := client.GetDeviceSettingNotDisturbInfo(&model.GetDeviceSettingNotDisturbInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceSettingNotDisturbInfo   =====> ", ressndi, errsndi)

	resdf, errdf := client.DeviceFindOne(&model.DeviceFindOneReq{DeviceNum: deviceNum})
	fmt.Println("DeviceFindOne   =====> ", resdf, errdf)

	resdsoci2, errdsoci2 := client.GetDeviceSettingOfflineCardInfo(&model.GetDeviceSettingOfflineCardInfoReq{DeviceNum: deviceNum})
	fmt.Println("GetDeviceSettingOfflineCardInfo   =====> ", resdsoci2, errdsoci2)

	resoll, erroll := client.OnlineLog(&model.OnlineLogReq{DeviceNum: deviceNum, PageModel: model.PageModel{Page: 1, Limit: 10}})
	fmt.Println("OnlineLog   =====> ", resoll, erroll)

	res, err = client.DeviceStateRestart(&model.DeviceStateRestart{DeviceNums: &[]string{deviceNum}})
	fmt.Println("DeviceStateRestart   =====> ", res, err)

	res, err = client.DeviceStateOffline(&model.DeviceStateOffline{DeviceNums: &[]string{deviceNum}})
	fmt.Println("DeviceStateOffline   =====> ", res, err)

	res, err = client.DeviceStateOfflineProfit(&model.DeviceStateOfflineProfit{DeviceNums: &[]string{deviceNum}})
	fmt.Println("DeviceStateOfflineProfit   =====> ", res, err)

	res, err = client.DeviceStatePortError(&model.DeviceStatePortError{DeviceNums: &[]string{deviceNum}})
	fmt.Println("DeviceStatePortError   =====> ", res, err)

	resds, errds := client.DeviceState(&model.DeviceStateReq{DeviceNum: deviceNum, PortFields: []string{"state", "eq_used"}})
	fmt.Println("DeviceState   =====> ", resds, errds)
}
